<?php
/**
 * Created by PhpStorm.
 * User: Gooraye
 * Date: 2015/12/18
 * Time: 9:46
 */

namespace Test\Controller;

use Api\Vendor\UMeng\BoyePushApi;

class TestBoyePushApiController extends TestController
{

    function _initialize()
    {
        parent::_initialize();
        vendor('BoyePushApi',APP_PATH.'Api/Vendor/Umeng/','.class.php');
    }

    protected $Android_appkey = '566a2ca9e0f55a22970058e4';
    protected $Android_secret = 'wcofhrfjmxtyfs5zhrncgc3tghmnu8zv';

    protected $IOS_appkey = '566a2d5be0f55aad84007870';
    protected $IOS_secret = 'pr46ljmfctsfxo5kbsqadxqyxqaull5e';

    public function index(){
        $this->test2();

    }

    private function test1(){
        $BoyePushApi = new BoyePushApi();

        $param = array(
            'alert' => '测试消息推送API IOS',
            'ticker' => '测试消息推送API 安卓 提示文字',
            'title' => '测试消息推送API 安卓 标题',
            'text' => '测试消息推送API 安卓 文字描述'
        );

        $result = $BoyePushApi->sendAll($param);

        dump($result);
    }

    private function test2(){
        $BoyePushApi = new BoyePushApi();
        $uid = 34;
        $param = array(
            'alert' => '测试消息推送API IOS',
            'ticker' => '测试消息推送API 安卓 提示文字',
            'title' => '测试消息推送API 安卓 标题',
            'text' => '测试消息推送API 安卓 文字描述'
        );
        $result = $BoyePushApi->send($uid,$param);
        dump($result);
    }

}